curl https://9d5e5823.ghelper.me/subs/clash/6c390f749d5e58236722074ff52028d8 > /tmp/clash_conf.yaml

clash -f /tmp/clash_conf.yaml &
set -x http_proxy http://127.0.0.1:9981
set -x https_proxy http://127.0.0.1:9981
set -x GIT_HTTP_PROXY http://127.0.0.1:9981
set -x GIT_HTTPS_PROXY http://127.0.0.1:9981

set PID (pidof clash)
echo clash pid $PID
disown $PID

function cleanup_proxy -p %self
    killall clash
    set -x http_proxy 
    set -x https_proxy 
    set -x GIT_HTTP_PROXY 
    set -x GIT_HTTPS_PROXY
    
    set -e http_proxy 
    set -e https_proxy 
    set -e GIT_HTTP_PROXY 
    set -e GIT_HTTPS_PROXY
end
